    <?php
   
    
    
    printTree(0);
    
    
    function printTree($parentId) {
        
        
        $queryTree ="SELECT * FROM [php_property:table] WHERE item_parent_id =" . $parentId;
        $resultTree=mysql_query($queryTree);

        if (mysql_affected_rows() > 0)
            {
            echo "<ul>";

            while ($lineTree=mysql_fetch_array($resultTree))
                {
                $lineTree = array_change_key_case($lineTree);
                echo "<li>" . $lineTree['titel'] . "</li>";
                 printTree($lineTree['id']);     
                
                }

            echo "</ul>";

            mysql_free_result($resultTree);
            }
        } 
        

    
    ?>
